package com.yongoe.ecy.firstNode.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yongoe.ecy.firstNode.entity.FirstNode;
import com.yongoe.ecy.firstNode.entity.GraphData;
import com.yongoe.ecy.firstNode.mapper.FirstNodeMapper;
import com.yongoe.ecy.firstNode.service.FirstNodeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 一级节点
 *
 * @author monad
 * @since 2024/03/10
 */
@Service
public class FirstNodeServiceImpl extends ServiceImpl<FirstNodeMapper, FirstNode> implements FirstNodeService {

    @Override
    public Page<FirstNode> getFirstNodeByPage(Page<FirstNode> page, FirstNode firstNode) {
        return baseMapper.getFirstNodeByPage(page, firstNode);
    }

    // 新增一级节点
    @Override
    public Long addFirstNode(FirstNode firstNode) {
        return baseMapper.addFirstNode(firstNode);
    }

    // 更新一级节点
    @Override
    public void updateFirstNode(FirstNode firstNode) {
        baseMapper.updateFirstNode(firstNode);
    }

    // 批量删除一级节点(neo4j)
    @Override
    public void deleteFirstNodes(Long[] ids) {
        baseMapper.deleteFirstNodes(ids);
    }

    // 批量删除一级节点(mysql)
    @Override
    public void deleteByIds(Long[] ids) {
        baseMapper.deleteByIds(ids);
    }

    // 删除全部一级节点(neo4j)
    @Override
    public void deleteAllNode() {
        baseMapper.deleteAllNode();
    }

    // 删除全部一级节点(mysql)
    @Override
    public void removeAll() {
        baseMapper.removeAll();
    }

    // 查询子节点
    @Override
    public int selectChild(Long[] ids) {
        return baseMapper.selectChild(ids);
    }

    @Override
    public List<GraphData> getNodeGraph(Long nodeId) {
        return baseMapper.getNodeGraph(nodeId);
    }

}
